/**
 * Created by YongX on 2017/5/27.
 */
import Router from 'vue-router';

const Index = resolve => require(['@/components/Index.vue'], resolve);
const Home = resolve => require(['@/components/admin/DashBoard.vue'], resolve);
const Register = resolve => require(['@/components/Register.vue'], resolve);
const Login = resolve => require(['@/components/Login.vue'], resolve);
const DashBoard = resolve => require(['@/components/admin/DashBoard.vue'], resolve);
const MenuCom = resolve => require(['@/components/admin/Menu.vue'], resolve);
const Users = resolve => require(['@/components/admin/user/Users.vue'], resolve);
const UserEdit = resolve => require(['@/components/admin/user/Edit.vue'], resolve);
const Role = resolve => require(['@/components/admin/user/Role.vue'], resolve);
export default new Router({
    mode: 'history',
    base: __dirname,
    routes: [
        {path: '/index', name: 'Index', component: Index},
        {path: '/register', name: 'Register', component: Register},
        {path: '/login', name: 'Login', component: Login},
        {path: '/admin/home', name: 'Home', component: Home},
        {path: '/admin/dashboard', name: 'DashBoard', component: DashBoard},
        {path: '/admin/menu', name: 'Menu', component: MenuCom},
		{path: '/admin/user/list', name: 'Users', component: Users},
		{path: '/admin/user/edit', name: 'UserEdit', component: UserEdit},
		{path: '/admin/user/role', name: 'Role', component: Role},
        {path: '*', redirect: {name: 'Index'}}
    ]
});
